Key cards may be used to control access to a facility. For example, a hotel guest may book a hotel room and the hotel staff may provide the hotel guest with a key card. The key card may be configured to open the lock on the guest's hotel room and may not be able to open any other rooms in the hotel. As another example, an office building may include locks on doors and elevators. A worker in the office may be given a key card configured to open particular doors and/or to enable an elevator to stop on a particular floor. A key card may use a bar code, a magnetic stripe, a radio frequency identification tag, and/or another method to store a code that may be used to match a code in a lock in order to open the lock.